#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int n;
	cin >> n;
	double sum=0.0;
	for (int i = 0;i < n;i++)
	{
		double x, y;
		int p;
		cin >> x >> y >> p;
		double dis = sqrt(x * x + y * y);
		sum += dis / 50 + p + dis / 50 + p * 0.5;
	}
	cout << (int)ceil(sum);

	return 0;
}